/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.opgea.token.domain.entities;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * 
 * @author Ramesh
 */
@Embeddable
public class LoginPK implements Serializable {

    private static final long serialVersionUID = 1268741520198757649L;
    @Basic(optional = false)
    @Column(name = "companyId")
    private long companyId;
    @Basic(optional = false)
    @Column(name = "loginId")
    private String loginId;

    public LoginPK() {
    }

    public LoginPK(long companyId, String loginId) {
	this.companyId = companyId;
	this.loginId = loginId;
    }

    public long getCompanyId() {
	return companyId;
    }

    public void setCompanyId(long companyId) {
	this.companyId = companyId;
    }

    public String getLoginId() {
	return loginId;
    }

    public void setLoginId(String loginId) {
	this.loginId = loginId;
    }

    @Override
    public int hashCode() {
	int hash = 0;
	hash += (int) companyId;
	hash += (loginId != null ? loginId.hashCode() : 0);
	return hash;
    }

    @Override
    public boolean equals(Object object) {
	if (!(object instanceof LoginPK)) {
	    return false;
	}
	LoginPK other = (LoginPK) object;
	if (this.companyId != other.companyId) {
	    return false;
	}
	if ((this.loginId == null && other.loginId != null)
		|| (this.loginId != null && !this.loginId.equals(other.loginId))) {
	    return false;
	}
	return true;
    }

    @Override
    public String toString() {
	return "com.opgea.qms.domain.entities.generated.LoginPK[ companyId="
		+ companyId + ", loginId=" + loginId + " ]";
    }

}
